/*    
    OpenMheg - A free MHEG-5 library
    Copyright (C) 2008 Dharmesh Malam

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using Core.Model.Data.Generics;

using Core.Model.Data.Variables;
using Core.Model.Events;

namespace Core.Model.Ingredients.Presentable.Visibles
{
 public class DynamicLineArt :LineArt
{


  public override void InittInternalAttributes()
  {
    base.InittInternalAttributes();
         
  }

  //  Actions
  public override void SetBoxSize(GenericInteger width, GenericInteger height)
  {
    base.SetBoxSize(width, height);
    //notifyObservers();
  }

  public override void SetPosition(GenericInteger newX, GenericInteger newY)
  {
    base.SetPosition(newX, newY);
   // notifyObservers();
  }


     public override void SetLineWidth ( GenericInteger newWidth )
  {
    LineWidth = newWidth.Value;
  }

     public override void SetLineStyle ( GenericInteger newStyle )
  {
    LineStyle = (LineArtLineStyle) newStyle.Value;
  }

     public override void SetLineColour ( GenericColour newColor )
  {
    RefLineColour = newColor;
  }

     public override void SetFillColour ( GenericColour newColor )
  {
    RefFillColour = newColor;
  }

  public void GetLineWidth(IntegerVariable lineWidthVar)
  {
    lineWidthVar.Value = LineWidth;
  }

  public void GetLineStyle(IntegerVariable lineStyleVar)
  {
    lineStyleVar.Value = (int) LineStyle;
  }

  //  todo: check this is correct
  public void GetLineColour(OctetStringVariable lineColourVar)
  {
    //int name = refLineColour.getRGB();
    //char[] rgb = new char[3];
    //rgb[0] = (char)(name % 0x100);
    //name /= 0x100;
    //rgb[1] = (char)(name % 0x100);
    //name /= 0x100;
    //rgb[2] = (char)(name % 0x100);

    //lineColourVar.setValue(new String(rgb));
  }

  public void GetFillColour(OctetStringVariable fillColourVar)
  {
    //int name = refFillColour.getRGB();
    //char[] rgb = new char[3];
    //rgb[0] = (char)(name % 0x100);
    //name /= 0x100;
    //rgb[1] = (char)(name % 0x100);
    //name /= 0x100;
    //rgb[2] = (char)(name % 0x100);

    //fillColourVar.setValue(new String(rgb));
  }

  public void DrawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
  {
    //renderer.drawArc(x, y, width, height, startAngle, arcAngle);
  }

  public void DrawSector(int x, int y, int width, int height, int startAngle, int arcAngle)
  {
    //renderer.drawSector(x, y, width, height, startAngle, arcAngle);
  }

  public void DrawLine(int x1, int y1, int x2, int y2)
  {
    //renderer.drawLine(x1, y1, x2, y2);
  }

  public void DrawOval(int x, int y, int width, int height)
  {
    //renderer.drawOval(x, y, width, height);
  }

  public void DrawPolygon(List<Point> pointList)
  {
    //renderer.drawPolygon(pointList);
  }

  public void DrawPolyline(List<Point> pointList)
  {
    //renderer.drawPolyline(pointList);
  }

  public void DrawRectangle(int x1, int y1, int x2, int y2)
  {
    //renderer.drawRectangle(x1, y1, x2, y2);
  }

  public void Clear()
  {
    //renderer.clear();
  }

  public override void SetData (Core.Model.Data.Generics.GenericContentRef newContent )
  {
      base.SetData( newContent );
      Engine.MHEGEngine.Instance.AsyncHandle( new ContentAvailable( this ) );

  }

  public override void SetData (Core.Model.Data.Generics.GenericOctetString newContent )
  {
      base.SetData( newContent );
      Engine.MHEGEngine.Instance.AsyncHandle( new ContentAvailable( this ) );
  }
}
}
